#! /bin/bash

outname="3d-heat"
for exe in $outname
do
    rm ./$exe.txt
    for i in `seq 2 1 10`;
    do
        ../$exe/exe-$exe $i $i $i 1000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 12 2 30`;
    do
        ../$exe/exe-$exe $i $i $i 1000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 40 10 100`;
    do
        ../$exe/exe-$exe $i $i $i 1000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
    for i in `seq 125 25 250`;
    do
        ../$exe/exe-$exe $i $i $i 1000 >> ./$exe.txt 
        echo  $i >> ./$outname.cpulist
    done
done


echo -e "np\tGStencils" > ./$outname.data.txt
cat ./$outname.txt |awk -F "= " '{print $NF}'| paste $outname.cpulist -  | awk '{print $1 "\t" $2 }' >>  ./$outname.data.txt
rm ./$outname.cpulist
rm ./$outname.txt